<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>


<script src="../js/vue.js"></script>
<div id="app">
  <cpn2></cpn2>

</div>

<script>


/*  const cpn1 = Vue.extend({
    template:`
       <div>
        <h2>我是标题1</h2>
        <p>我是内容，哈哈哈哈哈1</p>
        <p>我是内容，呵呵呵1</p>
      </div>
    `
  })*/

  //全局组件的语法糖
  Vue.component('cpn1',{
    template:`
       <div>
        <h2>我是标题1</h2>
        <p>我是内容，哈哈哈哈哈1</p>
        <p>我是内容，呵呵呵1</p>
      </div>
    `
  })



  const app = new Vue({
    el: '#app',
    data: {
      message: "第一次，系统的学VUE"
    },
    components:{
      //局部组件的语法糖
      cpn2:{
        template:`
       <div>
        <h2>我是标题2</h2>
        <p>我是内容，哈哈哈哈哈2</p>
        <p>我是内容，呵呵呵2</p>
      </div>
    `
      }
    }

  })
</script>
</body>
</html>